<template>
  <div>
    <h2>{{ wing }}</h2>
    <button @click="goto">点击去son1query</button>
    <button @click="go">点击去son1params</button>
    <router-link to="/hi/sonOne?nameid=232425&name=张三">点击</router-link>
    <br />
    <router-view></router-view>
  </div>
</template>

<script>
export default {
  name: 'DemoHi',

  data() {
    return {
      wing: '嗨',
    }
  },

  mounted() {},

  methods: {
    goto() {
      //使用 query查询参数的时候在页面使用path引入
      this.$router.push({ path: '/hi/sonOne', query: { useId: '123456' } })
    },
    go() {
      //使用params查询参数的时候在页面使用name引入
      this.$router.push({ name: 'sonOne', params: { useID: 789 } })
    },
  },
}
</script>

<style lang="scss" scoped>
</style>